<?php
namespace app\index\model;
use think\Model;
use think\Request;
use think\Session;
class Useradmin extends Model
{
    public function UpdateOneData($userid,$adminid){
        $res=db('useradmin')->where('userid',$userid)->find();
        //var_dump($res);die;
        if($res['id']){
            $arr=db('useradmin')->where(['userid'=>$userid])->update(['adminid'=>$adminid]);
            return $arr;
        }
        else{
            $this->data(['userid'=>$userid,'adminid'=>$adminid]);
            $arr=$this->save();
            return $arr;
        }
    }
}